package com.cn.wanxi.service.impl;

import com.cn.wanxi.dao.CompanyDao;
import com.cn.wanxi.dao.CompanyFindAllDao;
import com.cn.wanxi.dao.impl.CompanyDaoImpl;
import com.cn.wanxi.dao.impl.CompanyFindAllImpl;
import com.cn.wanxi.model.CompanyModel;
import com.cn.wanxi.model.ResultModel;
import com.cn.wanxi.service.CompanyService;
import redis.clients.jedis.Jedis;

public class CompanyServiceImpl implements CompanyService {
    @Override
    public CompanyModel getCompanys() {
        CompanyModel companyModel = new CompanyModel();
        boolean isHave = false;
        if(isHave){

        }else{
            CompanyDao companyDao = new CompanyDaoImpl();
            companyModel = companyDao.findCompany();
            Jedis jedis = new Jedis();
            jedis.set("logo", companyModel.getLogo());
            jedis.set("phone", companyModel.getPhone());
            jedis.set("ad", companyModel.getAd());
            jedis.set("net", companyModel.getNet());
            jedis.set("email", companyModel.getEmail());
            jedis.set("version", companyModel.getVersion());
            jedis.set("address", companyModel.getAddress());
            jedis.set("advertisement", companyModel.getAdvertisement());
            jedis.set("name", companyModel.getName());


        }
        return companyModel;
    }
}
